package com.cdks.wuxiu.api.service.mysql;

import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cdks.wuxiu.entity.mysql.CallSheetInfo;
import com.cdks.wuxiu.entity.mysql.UserBaseInfo;

/**
 * 通话信息表 服务类
 */
public interface CallSheetInfoService extends IService<CallSheetInfo> {
    CallSheetInfo getByUcid(String ucid);
    CallSheetInfo getByUcidWithCaller(String ucid, long caller);
    CallSheetInfo getByUcidWithAnswer(String ucid, long answer);
    CallSheetInfo getByUcidWithAnyUser(String ucid, long userId);
    CallSheetInfo getBusyCallByCaller(long caller);
    CallSheetInfo getBusyCallByAnswer(long answer);
    CallSheetInfo getBusyCallAnyUser(long caller, long answer);
    CallSheetInfo getPayedCallBothUser(long callerId, long answerId);
    CallSheetInfo getStartedCallAnyUser(long callerId, long answerId);
    CallSheetInfo getStartedCallBothUser(long callerId, long answerId);
    CallSheetInfo getBySipId(String sipId);
    
    UserBaseInfo selectCallee(long selfId, int userType, int role, int sex, int balance, Set<Long> excludes);
    UserBaseInfo getRandAnswer(long selfId, int userType, int role, int sex, int balance, Set<Long> excludes);
    
    List<UserBaseInfo> getNoticeCallee(long caller, int userType, int role, Set<String> excludes);
    List<UserBaseInfo> getRandCallee(long selfId, int userType, int role, int sex);
    List<CallSheetInfo> getFreeCallByCaller(long caller);

    int callout(CallSheetInfo record);
    int ringing(CallSheetInfo record);
    int answer(CallSheetInfo record);
    int hangup(CallSheetInfo sheet);
    int update(CallSheetInfo sheet);
    int keepAlive(CallSheetInfo sheet, long payedCost);
    int record(String ucid, String info);
    int setSipId(String ucid, String sipId);
    int updateSheetByStatus(CallSheetInfo sheet, int status);
}
